package cn.seecoder.courselearning.vo.reply;

import cn.seecoder.courselearning.po.reply.Reply;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NonNull;

import java.util.Date;
import java.util.List;

@Data
public class ReplyVO {
    private Integer id;

    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private Integer userId;

    private String userName;

    private Integer courseId;

    private String courseName;

    private Integer replyingCommentId;

    private Integer replyingUserId;




    public ReplyVO(){

    }

    public ReplyVO(@NonNull Reply reply) {
        id = reply.getId();
        content = reply.getContent();
        ;
        createTime = reply.getCreateTime();
        userId = reply.getUserId();
        courseId = reply.getCourseId();
        replyingCommentId = reply.getReplyingCommentId();
    }
    public ReplyVO(@NonNull Reply reply,String userName, String courseName){
        id = reply.getId();
        content = reply.getContent();;
        createTime = reply.getCreateTime();
        userId = reply.getUserId();
        courseId = reply.getCourseId();
        this.userName =userName;
        this.courseName = courseName;
    }
}
